#include "comm.hpp"

int main()
{
    int shmid = shmCreate(4096);
    // 要是4kb的整数倍
    if (shmid < 0) {
        perror("shmCreate failed");
        return 1;
    }

    char* addr = (char*)shmat(shmid,nullptr,0);
    sleep(2);

    int i = 0;
    while(i++<26)
    {
        printf("client %s\n",addr);
        sleep(1);
    }
    shmdt(addr);
    sleep(2);
    destroyShm(shmid);
    return 0;
}